﻿<Page x:Class="Hotel.WPF.ui.ChaineHotel.P_ChaineHotel"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:extToolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit.Extended"
      mc:Ignorable="d" 
      d:DesignHeight="481" d:DesignWidth="919"
	Title="Gestion des chaines d'hotels" Loaded="Page_Loaded">

    <extToolkit:BusyIndicator IsBusy="False" BusyContent="Chargement de la page en cours..." x:Name="busyTool" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0,0,0,0" Width="900" Height="520">
        <Grid>
            <Label Content="GESTION DES CHAINES D'HOTELS" Height="28" Margin="10,10,49,0" Name="label1" VerticalAlignment="Top" Background="#FFD3DCF2" FontWeight="Bold" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
            <!--<TabControl Margin="10,43,12,12" Name="tbCH">
                <TabItem Header="Chaïne d'hotels" Name="ti_ch">
                    <Grid>-->
            <GroupBox Header="Ajout d'une chaîne d'hotel" Height="70" HorizontalAlignment="Left" Margin="10,56,0,0" Name="gbAdd" VerticalAlignment="Top" Width="565">
                <Grid>
                    <Label Content="Nom Chaine d'Hotel" Height="28" HorizontalAlignment="Left" Margin="14,10,0,0" Name="label2" VerticalAlignment="Top" />
                    <TextBox Height="23" HorizontalAlignment="Left" Margin="147,10,0,0" Name="tb_NomChaineHotel" VerticalAlignment="Top" Width="236" />
                    <Button Content="Ajouter" Height="23" HorizontalAlignment="Left" Margin="401,10,0,0" Name="bt_ajouter" VerticalAlignment="Top" Width="126" Click="bt_ajouter_Click" />

                </Grid>
            </GroupBox>
            <Rectangle Height="250" HorizontalAlignment="Left" Margin="5,172,0,0" Name="rectangle1" Stroke="Black" VerticalAlignment="Top" Width="293" Fill="#FFB1F2B1" />
            <Label Content="Liste des chaînes d'hotel" Height="28" HorizontalAlignment="Left" Margin="10,144,0,0" Name="label3" VerticalAlignment="Top" FontWeight="Bold" />
            <DataGrid AutoGenerateColumns="False" ItemsSource="{Binding}" Height="229" HorizontalAlignment="Left" Margin="10,182,0,0" Name="dg_ChaineHotel" VerticalAlignment="Top" Width="278" IsReadOnly="True" PreviewMouseRightButtonDown="dg_ChaineHotel_PreviewMouseRightButtonDown">
                <DataGrid.Resources>
                    <ContextMenu x:Key="DataRowContextMenu">
                        <MenuItem Header="Editer" Name="editMenu" Click="editMenu_Click" CommandParameter="{Binding}" />
                        <MenuItem Header="Supprimer" Name="deleteMenu" Click="deleteMenu_Click" />
                    </ContextMenu>
                </DataGrid.Resources>
                <DataGrid.RowStyle>
                    <Style TargetType="{x:Type DataGridRow}" x:Name="styleForDataRow">
                        <EventSetter Event="PreviewMouseLeftButtonDown" Handler="dg_ChaineHotel_PreviewMouseRightButtonDown" />
                        <Setter Property="ContextMenu" Value="{StaticResource DataRowContextMenu}">
                        </Setter>
                    </Style>
                </DataGrid.RowStyle>
                <DataGrid.Columns>
                    <DataGridTextColumn Header="Nom" Binding="{Binding Nom_Chzine_Hotel}" IsReadOnly="True" Width="200" />
                    <DataGridTemplateColumn Header="" Width="60">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <Button Click="gererListeChaineHotel" CommandParameter="{Binding}" Content="Hotels" Cursor="Hand" Name="affHotelButton" Width="50" />
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                </DataGrid.Columns>
            </DataGrid>

            <Rectangle Height="250" Margin="319,172,6,0" Name="rectangle2" Stroke="Black" VerticalAlignment="Top" Fill="#FFEDF2B1" />
            <Label Content="Liste des hotels" Height="28" HorizontalAlignment="Left" Margin="320,145,0,0" Name="label4" VerticalAlignment="Top" FontWeight="Bold" />
            <DataGrid AutoGenerateColumns="False" ItemsSource="{Binding}" Height="229" Margin="330,182,18,0" Name="dg_hotel" VerticalAlignment="Top" MouseDoubleClick="dg_hotel_MouseDoubleClick">
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Ref_Pays.Nom_Pays}" Header="Pays" IsReadOnly="True" Width="100" />
                    <DataGridTextColumn Binding="{Binding Ville_Hotel}" Header="Ville" IsReadOnly="True" Width="100" />
                    <DataGridTextColumn Binding="{Binding Nom_Hotel}" Header="Hotel" IsReadOnly="True" Width="100" />
                    <DataGridTextColumn Binding="{Binding Classement_ID}" Header="Classement" IsReadOnly="True" Width="100" />
                    <DataGridTextColumn Binding="{Binding Telephone}" Header="Téléphone" IsReadOnly="True" Width="100" />
                    <DataGridTextColumn Binding="{Binding Fax}" Header="Fax" IsReadOnly="True" Width="100" />
                </DataGrid.Columns>
            </DataGrid>
            
            <!--</Grid>
                </TabItem>
                <TabItem Header="Hotels" Name="ti_h">
                    <Grid />
                </TabItem>
            </TabControl>-->

        </Grid>
    </extToolkit:BusyIndicator>
</Page>
